package com.Spring.autowire;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static void main(String[] args) {
		// 若将xml放在固定的包下那么就从bin目录下去查找，具体如下
		// ApplicationContext ctx = new
		// ClassPathXmlApplicationContext("com/Spring/autowire/beans-autowire1.xml");
		ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-autowire.xml");
		Person p1 = (Person) ctx.getBean("person1");
		System.out.println(p1.toString());
	}
}
